<?php $mainbar = 'main';
 $pageId="page-product-list";
 $pages = $products->getLastPage();
?>
@extends('ios.pageIndex')

@section('page-content')
<div class="content-padded">

 <h3 class="text-center">{{$contentTitle}}</h3>
 @if(count($products) > 0)
 <div class="row m-product-list row-wrap">
 	@foreach($products as $key=>$p)
    <div class="col-100 horizontal-50">
	    <a href="{{URL::to('product',$p->id)}}" title="{{$p->name}}" class="external">
	    <div class="img-wrap">
	    	<img src="{{Images::url($p->image,600,720)}}" alt="{{$p->name}}"/>
	    </div>
	    
	    <div class="flex align-start item-content">
	    	<div>{{$p->brand}}</div>
	    	<div class="{{ $p->discount_price > 0 ? 'line-through' : ''}}">¥{{number_format($p->price,2)}}</div>
	    	 
	    </div>
	    <div class="flex">
	    	<div>{{$p->name}}</div>
	    	 @if($p->discount_price > 0)
	    	<div class="text-red">¥{{number_format($p->discount_price,2)}}</div>
	    	@endif
	    </div>
	    </a>
    </div>
    @endforeach
 </div>
 @else
 	@if(empty($search))
 		<div class="m-products-empty">暂无数据</div>
 	@else
 		<div class="m-products-empty">您的搜索无结果</div>
 	@endif
	
 @endif
 <div class="clear"></div><!-- 兼容android微信不支持flex问题 -->
</div>
@stop